package com.zy.hash.consistent;

import lombok.Data;

/**
 * @author zhaoyi
 * @date 2021/7/21 15:15
 * 虚拟节点
 * [min,max)
 */
@Data
public class VirtualNode implements Comparable<VirtualNode> {

    private Integer max;
    private Integer id;

    private CacheNode cacheNode;

    public VirtualNode(Integer id, Integer max) {
        this.id = id;
        this.max = max;
    }

    @Override
    public int compareTo(VirtualNode node) {
        return this.max.compareTo(node.max);
    }
}
